package com.example.demo.service;

import com.example.demo.mapper.MessageInfoMapper;
import com.example.demo.model.MessageInfo;
import org.apache.logging.log4j.message.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {

    @Autowired
    private MessageInfoMapper messageInfoMapper;

    public Integer publishMessage(MessageInfo messageInfo) {
      return   messageInfoMapper.insertMessage(messageInfo);
    }


    public List<MessageInfo> getMessageList(){
        return messageInfoMapper.selectAllList();
    }
}
